From fd2cdc96b1ff0ce0853c34ce6fcc95e3159c63df Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Sun, 17 Oct 2010 23:19:02 -0500 Subject: [PATCH] Fix the computation of the width of dual-width fonts. --- debian/changelog | 8 ++- .../fix-fc-dual-font-width-calculation.diff | 59 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 debian/patches/fix-fc-dual-font-width-calculation.diff diff --git a/debian/changelog b/debian/changelog index e8e44e10834..92d3869a141 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,7 +21,13 @@ emacs23 (23.2+1-5) unstable; urgency=low emacs-snapshot. Thanks to Artem Chuprina for the report. (closes: #397757) - -- Rob Browning Mon, 18 Oct 2010 00:16:26 -0500 + * Apply upstream patch to fix the computation of the width of + dual-width fonts (fix-fc-dual-font-width-calculation.diff). + Thanks to mizuno hajime for the report + and Sven Joachim for tracking down the + patch. (closes: #588808) + + -- Rob Browning Mon, 18 Oct 2010 00:17:56 -0500 emacs23 (23.2+1-4) unstable; urgency=low diff --git a/debian/patches/fix-fc-dual-font-width-calculation.diff b/debian/patches/fix-fc-dual-font-width-calculation.diff new file mode 100644 index 00000000000..ab641c5e910 --- /dev/null +++ b/debian/patches/fix-fc-dual-font-width-calculation.diff @@ -0,0 +1,59 @@ +* The font width should now be computed correctly for dual-width fonts. + Patch: fix-fc-dual-font-width-calculation.diff + Provided-by: Sven Joachim + Date: Mon, 12 Jul 2010 16:32:53 +0200 + Added-by: Rob Browning + Status: incorporated upstream + + The Debian patch is taken from this upstream commit: + + revno: 99907 + author: Naohiro Aota + committer: Chong Yidong + branch nick: emacs-23 + timestamp: Wed 2010-06-30 10:22:18 -0400 + message: + Check FC_DUAL too. For such fonts, check width one by one (Bug#4129). + * xftfont.c (xftfont_open): Check font width one by one also when + spacing is dual. + + * ftfont.c (ftfont_open): Ditto. + +--- a/src/ChangeLog ++++ b/src/ChangeLog +@@ -8,6 +8,13 @@ + * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA + (Bug#6214). + ++2010-06-30 Naohiro Aota (tiny change) ++ ++ * xftfont.c (xftfont_open): Check font width one by one also when ++ spacing is dual. ++ ++ * ftfont.c (ftfont_open): Ditto. ++ + 2010-05-18 Chong Yidong + + * character.c (Fstring, Funibyte_string): Use SAFE_ALLOCA to +--- a/src/ftfont.c ++++ b/src/ftfont.c +@@ -1262,7 +1262,7 @@ + spacing = XINT (AREF (entity, FONT_SPACING_INDEX)); + else + spacing = FC_PROPORTIONAL; +- if (spacing != FC_PROPORTIONAL) ++ if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL) + font->min_width = font->average_width = font->space_width + = (scalable ? ft_face->max_advance_width * size / upEM + : ft_face->size->metrics.max_advance >> 6); +--- a/src/xftfont.c ++++ b/src/xftfont.c +@@ -429,7 +429,7 @@ + ascii_printable[i] = ' ' + i; + } + BLOCK_INPUT; +- if (spacing != FC_PROPORTIONAL) ++ if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL) + { + font->min_width = font->average_width = font->space_width + = xftfont->max_advance_width; diff --git a/debian/patches/series b/debian/patches/series index ea59bc3795b..f29aaa58457 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -13,3 +13,4 @@ prevent-string-stack-overflow.diff prevent-let-eval-apply-stack-overflow.diff use-safe-alloca-lisp-in-let-eval-apply-apply_lambda.diff fix-gnus-output-to-mail-with-live-rmail-buffers.diff +fix-fc-dual-font-width-calculation.diff -- 2.30.2